package com.fakesmoker.aidawnda.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fakesmoker.aidawnda.model.dto.team.TeamQueryRequest;
import com.fakesmoker.aidawnda.model.dto.team.UserJoinTeamRequest;
import com.fakesmoker.aidawnda.model.dto.team.UserQuitTeamRequest;
import com.fakesmoker.aidawnda.model.entity.Team;
import com.fakesmoker.aidawnda.model.entity.User;
import com.fakesmoker.aidawnda.model.vo.TeamVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 用户回用户标签表服务
 *
 * @author lcy
 */
public interface TeamService extends IService<Team> {

    /**
     * 校验数据
     *
     * @param team
     * @param add 对创建的数据进行校验
     */
    void validTeam(Team team, boolean add);

    /**
     * 获取查询条件
     *
     * @param teamQueryRequest
     * @return
     */
    QueryWrapper<Team> getQueryWrapper(TeamQueryRequest teamQueryRequest);
    
    /**
     * 获取用户回用户标签表封装
     *
     * @param team
     * @param request
     * @return
     */
    TeamVO getTeamVO(Team team, HttpServletRequest request);

    /**
     * 分页获取用户回用户标签表封装
     *
     * @param teamPage
     * @param request
     * @return
     */
    Page<TeamVO> getTeamVOPage(Page<Team> teamPage, HttpServletRequest request);

    /**
     * 创建队伍
     * @param team
     * @param loginUser
     * @return
     */
    Long addTeam(Team team, User loginUser);


    /**
     * 获取分页查询条件
     * @param teamQueryRequest
     * @param request
     * @return
     */
    QueryWrapper<Team> getPageQueryWrapper(TeamQueryRequest teamQueryRequest, HttpServletRequest request);

    /**
     * 用户可以加入队伍
     * @param userJoinTeamRequest
     * @param request
     * @return
     */
    Boolean joinTeam(UserJoinTeamRequest userJoinTeamRequest, HttpServletRequest request);
/**
     * 用户可以退出队伍
     * @param userQuitTeamRequest
     * @param request
     * @return
     */
    Boolean quitTeam(UserQuitTeamRequest userQuitTeamRequest, HttpServletRequest request);

}
